<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Administration</title>

<link href="css/modalbox.css" rel="stylesheet" type="text/css"/>
<script src="js/prototype.js" type="text/javascript"></script>
<script src="js/scriptaculous.js" type="text/javascript"></script>
<script src="js/effects.js" type="text/javascript"></script>
<script src="js/modalbox.js" type="text/javascript"></script>

<script src="js/extra.js" type="text/javascript"></script>
<link href="css/global.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="jscripts/tiny_mce/tiny_mce_gzip.js"></script>
<script type="text/javascript">
tinyMCE_GZ.init({
	plugins : 'safari,pagebreak,style,layer,table,save,advhr,advimage,spellchecker,advlink,iespell,inlinepopups,insertdatetime,preview,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template',
	themes : 'simple,advanced',
	languages : 'en, de',
	disk_cache : true,
	debug : false
});
</script>
<script src="js/tiny.js" type="text/javascript"></script>



</head>
<body>

<script type="text/javascript">
function sortable(){
	Sortable.create("list");
}
</script>
<form action="" method="post" name="form" id="form">

<div>
	<div class="table_head" style="width: 683px;">
		<div style="float: left; width: 50%; height: 20px;"><h1>Content</h1></div><div style="float: right; width: 49%; text-align:right;  height: 20px;"><img src="images/move.gif" style="border: none; cursor: pointer;" alt="Toogle" title="Toogle" onclick="Effect.toggle('mochoice','slide');" /></div>
	</div>
	
	<div id="mochoice">
		<div class="clear"></div>
		<div class="table_td_left"><div style="float: left;"></div><div style="float: left; line-height: 25px; margin-left: 2px; width: 80%;"> Chose a Module</div> </div>
		<div class="table_td_right" style="padding-right: 0; width: 477px;">
		<?php $trek = $_REQUEST['tree'];?>
		<select name="page_modulchose" id="chose" onchange="GetNewMoul('trigger',this.options[this.selectedIndex].value, 'GetContentModul','start', '<?php echo htmlentities($trek, ENT_QUOTES);?>', '<?php echo (int)$_REQUEST['nodeID'];?>'); this.selectedIndex='0'; sortable();" style="background-color: #E3E3E0; margin-top: 2px;" size="1">
			<option value="">Select One</option>
			<option value="fulltext">Content Paragraph</option>
			
		</select>
		</div>
		<div class="clear"></div>
		<div class="table_td_left"><div style="float: left;"></div><div style="float: left; line-height: 25px; margin-left: 2px; width: 80%;">
		<input type="submit" style="width: 120px; border: none; background: #996666; color: #ffffff; height: 22px;" name="Save" value="Save Content" onclick="Modalbox.show($('load<?php echo time();?>'), {title: this.title, width: 128, height: 30, overlayClose: false});" />
		
		</div> </div>
		<div class="table_td_right" style="padding-right: 0; width: 477px;">
					
		</div>
		<div class="clear"></div>
	</div>
	
	
	
	<div>
		<ul id="list" style="list-style: none; padding: 0; margin: 0;">
			<li id="trigger" style="list-style: none; padding: 0; margin: 0;"> </li>
				<?php
				if(is_array($_POST['page_content']) && COUNT($_POST['page_content'])){
					$tmpconverter = NULL;
					$count = 0;
					foreach($_POST['page_content'] AS $key => $value){
						$count++;
						$tmpconverter = split('_', $key);
						$this->Model->GenerateModules($key, $tmpconverter[0], $value, $count);
					}
				}
				?>
		</ul>	
	</div>
	<div>

	</div>
</div>
	
<input type="hidden" name="nodeID" value="<?php echo (int)$_REQUEST['nodeID'];?>" />
<input type="hidden" name="tree" value="<?php echo htmlentities($_REQUEST['tree'], ENT_QUOTES, 'UTF-8');?>" />


<div id="load<?php echo time();?>" style="display: none;">
	<img src="images/loading.gif" alt="Loading..." />
</div>
</form>
<div style="clear: both;"></div>

<?php
if(isset($_POST) && COUNT($_POST)){
	echo '<pre>';
	print_r($_POST);
	echo '</pre>';
	
}
?>

<script type="text/javascript">
sortable();
</script>
</body>
</html>